from base.Base import Base
from selenium.webdriver.common.by import By
import time

class Page_buy(Base):
    #点击进入电影评论接口
    button_loc={By.XPATH,'/html/body/div[1]/div/section/aside/ul/li/ul/li[2]/a'}
    def button(self):
        self.click(self.button_loc)
    #点击购买
    buy_loc={By.XPATH,'/html/body/div[1]/div/section/section/main/div[1]/div/div[1]/div[3]/div/div[1]/div/table/tbody/tr[1]/td[6]/div/button'}
    def buy(self):
        self.click(self.buy_loc)

    def buy_right(self):
        self.openurl("http://localhost:8080/")
        time.sleep(2)
        self.button()
        time.sleep(2)
        self.buy()
        time.sleep(2)
